import { getToken, getRole } from '@/utils/auth'
import { Component } from 'react'
import { getTenantid } from '@/utils/auth';
import router from 'umi/router';
class BasicLayout extends Component {
  constructor(props) {
    super(props)
  }
  componentWillMount() {

    if(getToken()) {
      if(getRole() === 10) {
        router.replace(`/manager/home/center`)
      } else {
        router.replace(`/worker/details`)
      }
    } else {
      router.replace(`/${getTenantid()}`)
    }
  }
  render() {
    return this.props.children
  }
}
export default BasicLayout